$(() => {
    template.defaults.imports.moment = moment

    const ary = location.search.slice(1).split('&')
    const paramsObj = {}
    ary.forEach((v) => {
        var r = v.split('=')
        paramsObj[r[0]] = decodeURIComponent(r[1])
    })
    $.ajax({
        type: 'get',
        url: `/posts/search/${paramsObj.key}`,
        success(res) {
            $('#articleListBox').html(template('articleListTPL', { res }))
        }
    })
})